package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.contract.constant.FileType;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;

import java.util.Date;
import javax.validation.constraints.NotNull;

import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.hr.example.EmpContractExample.E_COMPANY_ID;
import static org.jsola.hr.example.EmpContractExample.E_CONTRACT_ID;
import static org.jsola.hr.example.EmpContractExample.E_EMP_ID;
import static org.jsola.hr.example.EmpContractExample.E_END_TIME;
import static org.jsola.hr.example.EmpContractExample.E_NAME;
import static org.jsola.hr.example.EmpContractExample.E_REMARK;
import static org.jsola.hr.example.EmpContractExample.E_START_TIME;
import static org.jsola.hr.example.EmpContractExample.E_TERM_DAY;
import static org.jsola.hr.example.EmpContractExample.E_TERM_MONTH;
import static org.jsola.hr.example.EmpContractExample.E_TERM_YEAR;
import static org.jsola.hr.example.EmpContractExample.E_TYPE;
import static org.jsola.hr.example.EmpContractExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.EmpContractExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.EmpContractExample.M_EMP_ID_MAX;
import static org.jsola.hr.example.EmpContractExample.M_NAME_MAX;
import static org.jsola.hr.example.EmpContractExample.M_REMARK_MAX;
import static org.jsola.hr.example.EmpContractExample.N_COMPANY_ID;
import static org.jsola.hr.example.EmpContractExample.N_CONTRACT_ID;
import static org.jsola.hr.example.EmpContractExample.N_EMP_ID;
import static org.jsola.hr.example.EmpContractExample.N_END_TIME;
import static org.jsola.hr.example.EmpContractExample.N_NAME;
import static org.jsola.hr.example.EmpContractExample.N_REMARK;
import static org.jsola.hr.example.EmpContractExample.N_START_TIME;
import static org.jsola.hr.example.EmpContractExample.N_TERM_DAY;
import static org.jsola.hr.example.EmpContractExample.N_TERM_MONTH;
import static org.jsola.hr.example.EmpContractExample.N_TERM_YEAR;
import static org.jsola.hr.example.EmpContractExample.N_TYPE;

/**
 * 员工合同信息
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【员工合同信息】的参数")
@Data
public class EmpContractUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private String id;

    @ApiModelProperty(notes = N_CONTRACT_ID, example = E_CONTRACT_ID)
    private Long contractId;

    @ApiModelProperty(notes = N_EMP_ID, example = E_EMP_ID)
    @Length(max = 32, message = M_EMP_ID_MAX)
    private String empId;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = FileType.VALUES_STR)
    @Const(constClass = FileType.class, message = "合同类型不合法")
    private String type;

    @ApiModelProperty(notes = N_START_TIME, example = E_START_TIME)
    private Date startTime;

    @ApiModelProperty(notes = N_END_TIME, example = E_END_TIME)
    private Date endTime;

    @ApiModelProperty(notes = N_NAME, example = E_NAME)
    @Length(max = 80, message = "名称长度不能超过80")
    private String name;

    @ApiModelProperty(notes = N_TERM_YEAR, example = E_TERM_YEAR)
    private Integer termYear;

    @ApiModelProperty(notes = N_TERM_MONTH, example = E_TERM_MONTH)
    private Integer termMonth;

    @ApiModelProperty(notes = N_TERM_DAY, example = E_TERM_DAY)
    private Integer termDay;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 2147483647, message = M_REMARK_MAX)
    private String remark;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;


}

